#ifndef BONE_H_
#define BONE_H_

#include "BoneOrientation.h"
#include "BoneOrientationNode.h"
#include "Vector2D.h"
#include "TextureManager.h"

class BoneList;
class Bone
{
	BoneList * outgoingBones;
	
	BoneOrientation currentOrientation;
	BoneOrientation deltaOrientation;
	BoneOrientation * desiredOrientation;
	
	int textureIndex;
	Vector2D * textureVertices;
	Vector2D size;
	float skinLocation;
	TextureManager * textureManager;
	
	bool accelerating;
	float lengthAcceleration;
	float angleAcceleration;
	
	float angleModifier;
	float lengthModifier;
	float timeModifier;
	
	public:
	Bone( float angle, float length );
	Bone( float angle, float length, float width);
	Bone( BoneOrientation currentOrientation );
	Bone( BoneOrientation currentOrientation, TextureManager * textureManager, char * textureName, Vector2D * textureVertices, Vector2D size, float skinLocation );
	~Bone();
	
	void AddBone(Bone * bone);
	void AddBone(float angle, float length);
	
	void Think(double elapsedTime);
	void SetDesiredOrientation(BoneOrientation * desiredOrientation);
	void SetDesiredOrientation(BoneOrientationNode * desiredOrientationNode);
	void SetModifiers(float angleModifier, float lengthModifier, float timeModifier);
	bool CheckOrientation();
	bool CheckAllOrientation();
	BoneList * GetOutgoingBoneList();
	void Draw();
};
#endif /*BONE_H_*/
